package waitDemo;

public class Demo1 {
    public static void main(String[] args) {
        Object lOCK = new Object();
        Thread t1 = new Thread(()->{
            synchronized (lOCK) {
                try {
                    System.out.println("wait 之前");
                    lOCK.wait();
                    System.out.println("wait 之后");
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("哈哈");
            }

        });
//        Thread t2 = new Thread(()->{
//            synchronized (lOCK) {
//                System.out.println("唤醒wait方法");
//                lOCK.notify();
//            }
//        });
        t1.start();
//        t2.start();
    }
}
